package com.smart_home.back_end.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class test {
    @GetMapping("/open")
    public String open() {
        RestTemplate restTemplate = new RestTemplate();
        String res = restTemplate.getForObject("http://192.168.0.101/open", String.class);
        return res;
    }

    @GetMapping("/close")
    public String close() {
        RestTemplate restTemplate = new RestTemplate();
        String res = restTemplate.getForObject("http://192.168.0.101/close", String.class);
        return res;
    }

    @GetMapping("/status")
    public String status() {
//        RestTemplate restTemplate = new RestTemplate();
//        String res = restTemplate.getForObject("http://192.168.0.101/", String.class);
        return "res";
    }
}